import request from '@/utils/request';
/**
 * 分页查询
 * @param params
 * @returns {*}
 */
export function queryAllByPager(params) {
  return request({
    url: 'rest/api/portal/v1/manager/resource/pager',
    method: 'get',
    params
  });
}

/**
 * 保存
 * @param data
 * @returns {*}
 */
export function saveObject(data) {
  return request({
    url: 'rest/api/portal/v1/manager/resource/save/entity',
    method: 'post',
    data
  });
}

/**
 * 更新
 * @param data
 * @returns {*}
 */
export function updateObject(data) {
  return request({
    url: 'rest/api/portal/v1/manager/resource/update/entity',
    method: 'post',
    data
  });
}

/**
 * 删除
 * @param data
 * @returns {*}
 */
export function delObject(data) {
  return request({
    url: 'rest/api/portal/v1/manager/resource/del',
    method: 'post',
    data
  });
}

/**
 * 查询全部统计项
 * @returns {*}
 */
export function count() {
  return request({
    url: 'rest/api/portal/v1/manager/resource/count',
    method: 'get'
  });
}

/**
 * 游客查询全部统计
 * @returns {*}
 */
export function guestCount() {
  return request({
    url: 'rest/api/guest/portal/v1/query/resource/count',
    method: 'get'
  });
}

export function queryAllCustomPager(params) {
  return request({
    url: 'rest/api/portal/v1/manager/resource/custom/pager',
    method: 'get',
    params
  });
}

export function queryAllGuestCustomPager(params) {
  return request({
    url: 'rest/api/guest/portal/v1/query/resource/custom/pager',
    method: 'get',
    params
  });
}

export function queryMaxDownload() {
  return request({
    url: 'rest/api/portal/v1/manager/resource/max/entity',
    method: 'get'
  });
}

export function queryGuestMaxDownload() {
  return request({
    url: 'rest/api/guest/portal/v1/query/resource/max/entity',
    method: 'get'
  });
}

export function saveGuestDownload(data) {
  return request({
    url: 'rest/api/guest/portal/v1/query/resource/save',
    method: 'post',
    data
  });
}

export function saveDownload(data) {
  return request({
    url: 'rest/api/portal/v1/manager/resource/save',
    method: 'post',
    data
  });
}
